import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: 'cropsId',
    align:"center",
    dataIndex: 'cropsId'
   },
   {
    title: '司机账号',
    align:"center",
    dataIndex: 'driverId'
   },
   {
    title: '时间',
    align:"center",
    dataIndex: 'time'
   },
   {
    title: 'farmerNickName',
    align:"center",
    dataIndex: 'farmerNickName'
   },
   {
    title: '农户账号',
    align:"center",
    dataIndex: 'farmerUserName'
   },
   {
    title: 'farmerTel',
    align:"center",
    dataIndex: 'farmerTel'
   },
   {
    title: 'farmerDept',
    align:"center",
    dataIndex: 'farmerDept'
   },
   {
    title: '工厂ID',
    align:"center",
    dataIndex: 'factoryId'
   },
   {
    title: '运输状态（0，未运输，1，正在运输，2，运输完成）',
    align:"center",
    dataIndex: 'status_dictText'
   },
   {
    title: '0已入库 1已出库',
    align:"center",
    dataIndex: 'outFactoryStatus'
   },
   {
    title: '零售商签收状态',
    align:"center",
    dataIndex: 'retailerReceiveStatus'
   },
   {
    title: 'remarks',
    align:"center",
    dataIndex: 'remarks'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: 'cropsId',
    field: 'cropsId',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入cropsId!'},
          ];
     },
  },
  {
    label: '司机账号',
    field: 'driverId',
    component: 'Input',
  },
  {
    label: '时间',
    field: 'time',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
  },
  {
    label: 'farmerNickName',
    field: 'farmerNickName',
    component: 'Input',
  },
  {
    label: '农户账号',
    field: 'farmerUserName',
    component: 'Input',
  },
  {
    label: 'farmerTel',
    field: 'farmerTel',
    component: 'Input',
  },
  {
    label: 'farmerDept',
    field: 'farmerDept',
    component: 'Input',
  },
  {
    label: '工厂ID',
    field: 'factoryId',
    component: 'InputNumber',
  },
  {
    label: '运输状态（0，未运输，1，正在运输，2，运输完成）',
    field: 'status',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:""
     },
  },
  {
    label: '0已入库 1已出库',
    field: 'outFactoryStatus',
    component: 'InputNumber',
  },
  {
    label: '零售商签收状态',
    field: 'retailerReceiveStatus',
    component: 'InputNumber',
  },
  {
    label: 'remarks',
    field: 'remarks',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];



/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}